import allure

from pages.base_page import BasePage


class HomePage(BasePage):
    @property
    def phone_input(self):
        return self.page.get_by_placeholder("您的信息将被严格保密")

    @property
    def sms_code_input(self):
        return self.page.get_by_placeholder("请输入验证码")

    @allure.step("输入手机号和验证码")
    def submit_phone_info(self, phone: str, sms_code: str = "1234"):
        self.phone_input.click()
        self.phone_input.fill(phone)
        self.sms_code_input.fill(sms_code)